/*
 * Option.h
 *
 * 	Class to hold option contract data like strike, expiration, payoff etc., .
 *  It also has some member functions to determine the price.
 *
 *  Created on: Sep 29, 2009
 *      Author: karthik
 */

#ifndef OPTION_H_
#define OPTION_H_

#include <string>
#include "Date.h"
#include "PayOff.h"


class Option {

public:

	Date expiration;	// Expiration date of the option.
	double strike;		// Strike price of the option.
	bool isCall; 		// true if call option, false if put option.
	std::string symbol;	// Stock symbol.
	PayOff payoff;		// Payoff object used.

	Option();			// Default Constructor
	Option(std::string symbol, Date exp, double K, bool isCall){initialize(symbol,exp,K,isCall);};	// Constructor

	// Calculates call price of a single factor option using Black-Scholes formula.
	double call_price(double spot, double r,double volatility, Date current_date);

	// Initializes the object with the given data elements.
	void initialize(std::string symbol, Date exp, double K, bool isCall);

	virtual ~Option();	// Destructor
};

#endif /* OPTION_H_ */

